<%@ page pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/pages/head.jsp">
	<jsp:param value="管理员管理用户信息" name="title" />
</jsp:include>
</head>
<body>
	<jsp:include page="/pages/admin/admin_nav.jsp">
		<jsp:param value="user_m" name="fun" />
	</jsp:include>
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-1 col-0"></div>
			<div class="col-md-10 col-12">
				<div class="card border">
					<div class="card-header">
						<form class="form-inline"
							action="${pageContext.request.contextPath }/admin/admin_list_user.action"
							method="post">
							<div class="form-group">
								<input class="form-control mr-sm-2" type="text" name="s_un"
									value="${param.s_un }" placeholder="按用户名搜索" />
							</div>
							<div class="form-group">
								<button class="btn btn-outline-primary my-2 my-sm-0"
									type="submit">搜索</button>
							</div>
						</form>
					</div>
					<div class="card-body">
						<div class="table-responsive-xl">
							<table class="table table-striped table-hover table-sm">
								<thead>
									<tr>
										<th>#</th>
										<th>用户名</th>
										<th>角色</th>
										<th>电话</th>
										<th>地址</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${users }" var="user" varStatus="vs">
										<tr>
											<th>${vs.count }</th>
											<td><c:out value="${user.username }" escapeXml="true" /></td>
											<td>${(user.ident=="1") ? "管理员" : "普通用户" }</td>
											<td><c:out value="${user.telephone }" escapeXml="true" /></td>
											<td><c:out value="${user.address }" escapeXml="true" /></td>
											<td><button type="button"
													class="btn btn-sm btn-outline-danger"
													onclick="delConfirm('确定要删除该用户吗？','${pageContext.request.contextPath }/admin/admin_del_user.action','${user.id }','ajax_no')">删除</button></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--ending row-->
	</div>
	<jsp:include page="/pages/del_modal.jsp" />
</body>
</html>